package com.sunday.electric.ui;

import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;

import com.sunday.common.utils.Constants;
import com.sunday.common.widgets.loadingdialog.LoadingView;
import com.sunday.electric.R;
import com.sunday.electric.base.BaseActivity;
import com.sunday.electric.utils.SharePerferenceUtils;

import butterknife.Bind;
import butterknife.ButterKnife;

/**
 * Created by Administrator on 2016/1/7.
 */
public class SplashActivity  extends BaseActivity{
    @Bind(R.id.loading_view)
    LoadingView loadingView;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_splash);
        ButterKnife.bind(this);

        new Handler().postDelayed(new Runnable() {
            @Override
            public void run() {
                boolean isLogin = SharePerferenceUtils.getIns().getBoolean(Constants.IS_LOGIN,false);
                if(isLogin){
                    intent = new Intent(mContext,MainActivity.class);
                }else{
                    intent = new Intent(mContext,LoginActivity.class);
                }
                startActivity(intent);
                finish();
            }
        },5000);
    }
}
